
import java.io.File;

public class DirTree {
	File path = null;
	int spaces = 0;
	
	DirTree(File file){
		path = file;
	}

	DirTree(String pathString){
		this(new File(pathString));
	}
	
	public void show(){
		show(path);
	}

	public void show(File path) {
		spaces++;
		
		if (path.isDirectory()) {

			File[] paths = path.listFiles();
			for (File p : paths) {

				for (int i = 0; i < spaces; i++) {
					System.out.print(" ");
				}
				if (p.isDirectory()) {
					System.out.println(p.getName().toUpperCase());
					show(p);
				} else {
					System.out.println(p.getName());
				}
			}
			spaces--;
		} else {
			System.out.printf("Path %s is not a directory", path.getName());
		}
	}
	
	
	public static void main(String[] args) {
		(new DirTree(".")).show();
	}
	
}
